﻿using System;
using System.Collections.Generic;
using UnityEngine;

namespace H
{
	// Token: 0x02000273 RID: 627
	internal class H_State_XTC_W_In : H_State
	{
		// Token: 0x06001067 RID: 4199 RVA: 0x00068780 File Offset: 0x00066980
		public H_State_XTC_W_In(H_Members members) : base(members)
		{
		}

		// Token: 0x06001068 RID: 4200 RVA: 0x00068794 File Offset: 0x00066994
		public override void In(H_State.Message msg)
		{
			this.members.param.continuanceXTC_F++;
			this.members.AddCountXTC();
			base.CheckChangePersonalityState();
			this.members.PlayAnime("XTC_W_In", 0.2f);
			this.members.VoiceExpression(H_Voice.TYPE.XTC_F);
			this.members.MaleExpression(H_Expression_Male.TYPE.EJACULATION);
			this.ejaculated = false;
		}

		// Token: 0x06001069 RID: 4201 RVA: 0x00068800 File Offset: 0x00066A00
		public override void Main()
		{
			if (!this.ejaculated && this.timer >= this.ejaculationDelay)
			{
				this.Ejaculation();
			}
			else
			{
				this.timer += Time.deltaTime;
			}
			if (this.members.CheckEndAnime("XTC_W_In"))
			{
				if (!this.ejaculated)
				{
					this.Ejaculation();
				}
				base.CheckUrine();
				this.members.FemaleGageVal = this.members.FemaleGageStartVal();
				this.members.MaleGageVal = 0f;
				base.ChangeState(H_STATE.XTC_W_TREMBLE, null);
			}
		}

		// Token: 0x0600106A RID: 4202 RVA: 0x000688A4 File Offset: 0x00066AA4
		public override void Out()
		{
		}

		// Token: 0x0600106B RID: 4203 RVA: 0x000688A8 File Offset: 0x00066AA8
		private void Ejaculation()
		{
			List<Male> males = this.members.GetMales();
			int noInsMale = this.members.StyleData.noInsMale;
			for (int i = 0; i < males.Count; i++)
			{
				if ((noInsMale & 1 << i) != 0)
				{
					males[i].Ejaculation(this.members.param.manyEjaculation);
				}
			}
			this.members.MaleGageVal = 0f;
			this.ejaculated = true;
		}

		// Token: 0x0400118C RID: 4492
		private bool ejaculated;

		// Token: 0x0400118D RID: 4493
		private float ejaculationDelay = 0.5f;

		// Token: 0x0400118E RID: 4494
		private float timer;
	}
}
